package com.bjc.educms.controller;

import com.bjc.commonutils.R;
import com.bjc.educms.entity.CrmBanner;
import com.bjc.educms.service.CrmBannerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: guli_parent
 * @description: 前台控制器
 * @author: bjc
 * @create: 2020-10-18 18:59
 */
@RestController
@RequestMapping(value = "/educms/bannerfront")
//@CrossOrigin   //配置网关后不需要这个跨域注解了  否则会出问题  跨域两次跨回来了
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    /**
     * 查询所有banner
     * @return
     */
    @ApiOperation(value = "获取首页banner")
    @GetMapping(value = "/getAllBanner")
    public R getAllBanner() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list", list);
    }

}
